# 2024/2/2 11:20 HFL
import requests
"""
获取Cookies的值供其他接口使用
"""

class GetCookies():
    cookies = None


class ProductCookis():

    def login(self, url):
        response = requests.get(url=url)
        setattr(GetCookies, 'cookies', response.cookies)

    def get_cookies(self):
        response = getattr(GetCookies, 'cookies')
        print(response)
        return response


if __name__ == '__main__':
    url = 'https://www.baidu.com'
    pc = ProductCookis()
    pc.login(url=url)
    pc.get_cookies()
